A Complete Worst-Case Analysis of Heapsort with Experimental Verification of Its Results, A manuscript (MS)

نویسنده

  • Marek A. Suchenek
چکیده

Main results. A rigorous proof that the number of comparisons of keys performed in the worst case by Heapsort on any array of size N ≥ 2 is equal to: 2(N − 1) ( lg N − 1 2 + ε )− 2s2(N)− e2(N) + min(blg(N − 1)c, 2) + 6 + c, where ε, given by: ε = 1 + dlg (N − 1)e − lg (N − 1)− 2dlg (N−1)e−lg (N−1), is a function of N with the minimum value 0 and and the supremum value δ = 1− lg e+ lg lg e ≈ 0.0860713320559342, s2(N) is the sum of all digits of the binary representation of N , e2(N) is the exponent of 2 in the prime factorization of N , and c is a binary function on the set of integers defined by: c =  1 if N ≤ 2 dlgNe − 4

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Worst-case analysis of generalized heapsort algorithm revisited

In this paper we present a generalized heapsort algorithm and its worst-case complexity analysis. The weighted sum of the number of comparisons and movements has been defined as a measure of the complexity. Theoretical analysis suggests that, by this criterion, 3-heap should be optimal in the worst case, contradicting the findings of A. Paulik (Paulik, A., 1990, Worst-case analysis of a general...

متن کامل

On the Best Case of Heapsort

Although discovered some 30 years ago, the Heapsort algorithm is still not completely understood. Here we investigate the best case of Heapsort. Contrary to Ž . claims made by some authors that its time complexity is O n , i.e., linear in the Ž . number of items, we prove that it is actually O n log n and is, in fact, approximately half that of the worst case. Our proof contains a construction ...

متن کامل

Average-Case Analysis Using Kolmogorov Complexity

This expository paper demonstrates how to use Kolmogorov complexity to do the average-case analysis via four examples, and exhibits a surprising property of the celebrated associated universal distribution. The four examples are: average case analysis of Heapsort 17, 15], average nni-distance between two binary rooted leave-labeled trees 20], compact routing in computer networks 3], average-cas...

متن کامل

Introspective Sorting and Selection Algorithms

Quicksort is the preferred in-place sorting algorithm in many contexts, since its average computing time on uniformly distributed inputs is (N log N) and it is in fact faster than most other sorting algorithms on most inputs. Its drawback is that its worst-case time bound is (N 2). Previous attempts to protect against the worst case by improving the way quicksort chooses pivot elements for part...

متن کامل

The Ultimate Heapsort

A variant of Heapsort|named Ultimate Heapsort|is presented that sorts n elements in-place in (n log 2 (n + 1)) worst-case time by performing at most n log 2 n + (n) key comparisons and n log 2 n + (n) element moves. The secret behind Ultimate Heapsort is that it occasionally transforms the heap it operates with to a two-layer heap which keeps small elements at the leaves. Basically, Ultimate He...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • CoRR

دوره abs/1504.01459  شماره 

صفحات  -

تاریخ انتشار 2015